﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace Team3_ProjectGUIFinal
{
    class OldLocateAlgorithm : Algorithm
    {
        public OldLocateAlgorithm(String name) : base(name) { }
        public override System.Drawing.Bitmap DoAlgorithm(System.Drawing.Bitmap sourceImage)
        {
            MeanHSVAlgorithm mhs = new MeanHSVAlgorithm("mhs");
            Bitmap mhhs = mhs.DoAlgorithm(sourceImage);

            Bitmap equalized;
            
            if (mhs.Hue < 130.0 || mhs.Saturation < 0.21 )
            {
                EqualisationAlgorithm eq = new EqualisationAlgorithm("eq");
                equalized = eq.DoAlgorithm(sourceImage);
            }
            else
            {
                equalized = sourceImage;
            }


            //GaussianBlurAlgorithm gb = new GaussianBlurAlgorithm("gb");
            //Bitmap gaussianblur = gb.DoAlgorithm(equalized, 7);

            LocateLicensePlate loc = new LocateLicensePlate("loc");
            Bitmap returnImage = loc.DoAlgorithm(equalized);

            return returnImage;
        }
    }
}
